home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / spaceambush.swf / scripts / frame_286 / PlaceObject2_561_93 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2007-03-12  |  1.2 KB  |  53 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.amitavaplay == true)
  3.    {
  4.       if(_root.level == 4)
  5.       {
  6.          if(st == 1)
  7.          {
  8.             att = true;
  9.             st = 0;
  10.          }
  11.       }
  12.       if(_root.amitavaplay == false)
  13.       {
  14.          att = false;
  15.       }
  16.       if(att == true)
  17.       {
  18.          dx = _X - _root.tank._x;
  19.          dy = _Y - _root.tank._y;
  20.          d = Math.sqrt(dx * dx + dy * dy);
  21.          if(100 < d)
  22.          {
  23.             rad = Math.atan2(dy,dx) + 3.141592653589793;
  24.             deg = rad * 180 / 3.141592653589793;
  25.             _rotation = deg;
  26.             b = speed * Math.cos(rad);
  27.             p = speed * Math.sin(rad);
  28.             _X = _X + b;
  29.             _Y = _Y + p;
  30.             treadcheckb++;
  31.             if(5 < treadcheckb)
  32.             {
  33.                treadcountb++;
  34.                duplicateMovieClip(_root.treadb,"treadb" + treadcountb,16384 + (treadcountb % 800 + 8000));
  35.                treadcheckb = 0;
  36.             }
  37.          }
  38.          else if(0 < _root.amithealth)
  39.          {
  40.             this.gotoAndStop(2);
  41.          }
  42.          else
  43.          {
  44.             this.gotoAndStop(1);
  45.          }
  46.       }
  47.    }
  48.    else
  49.    {
  50.       this.gotoAndStop(1);
  51.    }
  52. }
  53.